package touchgestIT;

import gestIT.ExpContent;
import gestIT.ExpEventArgs;
import gestIT.Token;

public class TouchContent extends ExpContent {

    public TouchType Type;
    public int Id;
    
    public TouchContent(){
    	super();
    }
    
    public TouchContent(TouchType ty, int id){
    	super();
    	Type = ty;
    	Id = id;
    }
    
    @Override
    public boolean Accepts(ExpEventArgs args, Token token){
    	if (args.getClass() != TouchEventArgs.class)
    		return false;
    	
    	TouchEventArgs targs = (TouchEventArgs)args;
    	if (targs.Id != this.Id)
    		return false;
    	if (targs.type != this.Type)
    		return false;
    	return true;
    }
    
    @Override
    public boolean Consume(ExpEventArgs args, Token token){
    	
    	// if(args instanceof TouchEventArgs)
    	

    	TouchEventArgs targs = (TouchEventArgs)args;
    	TouchToken tToken = (TouchToken)token;
    	
    	tToken.Save(targs);
    	return true;
    	
    }	
    
}
